import { getMe } from "@/api/auth";
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useUser = defineStore('user', () => {
  const user = ref(null);
  
  async function getUserInfo() {
    const res = await getMe();
    console.log(res.user);
    
    user.value = res?.user
  }
  return {
    user,getUserInfo
  }
}, {
  unistorage: true, // 是否持久化
})
